package com.sh.doctors.cloud.resp;

import android.widget.ImageView;
import androidx.databinding.BindingAdapter;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
import com.bumptech.glide.Glide;
import com.google.gson.annotations.SerializedName;

@Entity(tableName = "articles")
public class AriticleBean {
    @PrimaryKey
    @ColumnInfo(name = "articleid")
    private int id;

    @ColumnInfo(name = "news_id")
    private String news_id;

    @SerializedName("title")
    private String title;

    @SerializedName("image_uri")
    private String image_uri;

    @BindingAdapter("android:src")
    public static void loadNewHeaderImg(ImageView view, String url) {
        Glide.with(view.getContext()).load(url).into(view);
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getImage_uri() {
        return image_uri;
    }

    public void setImage_uri(String image_uri) {
        this.image_uri = image_uri;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getNews_id() {
        return news_id;
    }

    public void setNews_id(String news_id) {
        this.news_id = news_id;
    }

    @Override
    public String toString() {
        return "AriticleBean{" +
                "id=" + id +
                ", news_id='" + news_id + '\'' +
                ", title='" + title + '\'' +
                ", image_uri='" + image_uri + '\'' +
                '}';
    }
}
